#ifndef SCOREMANAGER_H
#define SCOREMANAGER_H

/*!
 * \file     scoremanager.h
 * \brief    Manage score of the game.
 * \author   Duriez Franck
 * \author   Carton Paul-Henri
 * \version  0.1
 */

#include "drawable.h"
#include "action.h"

/*!
 * \class  ScoreManager
 * \brief  Manage score of the game.
 *
 * Manage score of the game.
 *
 * \todo Implement a better position system.
 * \todo Displayer score.
 * \todo Abstract this class.
 */
class ScoreManager : public Drawable /*{{{*/
{
	Q_OBJECT
/*{{{*/
public:
	/*!
	 * \brief Constructor.
	 * \param displayer : where display the new Objects
	 * \param dt        : pointer to the infinitesimal part of time
	 */
	ScoreManager(QSFMLWidget* displayer, float* dt);

	/*!
	 * \brief Return the level.
	 */
	int getLevel() const;

signals:
	void levelUp();

public slots:
	/*!
	 * \brief Raise the score.
	 *
	 * Raise the score in proportion with the number of line in destruction.
	 */
	void raiseScore(int linesdestroyed);

private:
	sf::String m_score_displayer; ///< Score displayer
	sf::Shape m_background;       ///< Background for the score displayer
	float m_score_efficient;      ///< Score of the player
	float m_score;                ///< Score displayed
	int m_level;                  ///< Level reached
	Vector2f m_position;          ///< Position (x,y) (Not used => use it implementing position system)
/*}}}*/

/**********
 * ACTION *
 **********/
/*{{{*/
private:
	/*!
	 * \brief This Action raise the score continiously
	 */
	Action<ScoreManager> raiseScoreAction;

	void raiseScoreStartingProcess();
	void raiseScoreProcess();
	void raiseScoreStoppingProcess();
/*}}}*/

/************
 * DRAWABLE *
 ************/
/*{{{*/
public:
	void draw() const;
	void update();

	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	void setCenter(Vector2f center);
	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	void setPosition(Vector2f position);
	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	void setRotation(float angle);

	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	void moveCenter(Vector2f dcenter);
	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	void move(Vector2f dposition);
	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	void rotate(float dangle);

	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	Vector2f getCenter() const;
	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	Vector2f getPosition() const;
	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	float getRotation() const;

	/*!
	 * \deprecated Not already implemented
	 * \brief Not implemented.
	 */
	std::string toString() const;
/*}}}*/
}; /*}}}*/

#endif // SCOREMANAGER_H
